/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.elcom.dailyexpress.mongodbdao;

import com.elcom.dailyexpress.mongodbobject.SmscbMessageResult;
import com.google.code.morphia.Datastore;
import com.google.code.morphia.dao.BasicDAO;
import com.google.code.morphia.query.Query;
import org.bson.types.ObjectId;

/**
 *
 * @author GiangLT
 */
public class SmscbMessageResultDao extends BasicDAO<SmscbMessageResult, ObjectId> {

    public SmscbMessageResultDao(Datastore ds) {
        super(ds);
    }
    
    public SmscbMessageResult findByMessageId(String messageId) {
        Query<SmscbMessageResult> query = ds.createQuery(SmscbMessageResult.class);
        return query.field("messageId").equal(messageId).get();
    }
}
